package cn.hnu.jpa.jpaExample.PrimaryKeyJoinColumn;



import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;

import org.junit.Test;


public class UnitTest {

	//@Test
	public void test() {
		EntityManagerFactory emf = Persistence.createEntityManagerFactory("jpa");
		EntityManager em = emf.createEntityManager();
		em.getTransaction().begin();
		PKJCCustomer cpk = new PKJCCustomer();
		PKJCAddress addr = new PKJCAddress();
		cpk.setName("zdc");
		addr.setAddr("123456");
		cpk.setAddr(addr);
		addr.setCustomer(cpk);
		em.persist(cpk);
		em.getTransaction().commit();
		em.close();
		emf.close(); 
	}

}
